package com.econ.powercloud.ems.util;


/**
 * @Author : zjf
 * @Description : 诊断预警redis缓存
 * @Date : 2022/12/5 8:57
 * @Modified by : zjf
 */
public class WarnCacheKeyUtils {

    private WarnCacheKeyUtils() {
    }

    public static final String EMS_WARN_PREFIX = "EMS:WARN:";

    public static final String CONFIG = "CONFIG:";

    public static final String RECORD = "RECORD";

    public static final String STAT = "STAT";

    private static final String WARN_CONFIG_KEY = EMS_WARN_PREFIX + CONFIG + "%s";

    private static final String WARN_RECORD_KEY = EMS_WARN_PREFIX + RECORD;

    private static final String WARN_STAT_KEY = EMS_WARN_PREFIX + STAT;

    /**
     * 获取预警配置key
     */
    public static String getWarnConfigKey(String deviceCode) {
        return String.format(WARN_CONFIG_KEY, deviceCode);
    }

    /**
     * 获取预警记录key
     */
    public static String getWarnRecordKey(){
        return WARN_RECORD_KEY;
    }

    /**
     * 获取预警统计key
     */
    public static String getWarnStatKey() {
        return WARN_STAT_KEY;
    }

}
